package com.flowplan.entity.enums;

/**
 * 优先级枚举
 * 
 * @author FlowPlan Team
 */
public enum Priority {
    /**
     * 高优先级
     */
    HIGH("HIGH", "高"),
    
    /**
     * 中等优先级
     */
    MEDIUM("MEDIUM", "中"),
    
    /**
     * 低优先级
     */
    LOW("LOW", "低");
    
    private final String code;
    private final String description;
    
    Priority(String code, String description) {
        this.code = code;
        this.description = description;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 根据代码获取枚举
     */
    public static Priority fromCode(String code) {
        for (Priority priority : values()) {
            if (priority.code.equals(code)) {
                return priority;
            }
        }
        throw new IllegalArgumentException("Invalid priority code: " + code);
    }
}